//加载条
import { ElMessageBox } from "element-plus";
import nprogress from "nprogress";
//确认框失效
import "element-plus/es/components/message-box/style/css";

//提示警示弹窗
export function showMessage(message = "提示消息", type = "success", customClass = "") {
  // message : 提示内容；
  //type : 默认为成功消息提示；
  //customClass : 用于传入自定义样式，默认为空；
  return ElMessage({
    message,
    type: type,
    customClass
  });
}

// 显示页面加载 Loading
export function showPageLoading() {
  nprogress.start();
}

// 隐藏页面加载 Loading
export function hidePageLoading() {
  nprogress.done();
}

// 弹出确认框
export function showModel(content = "提示内容", type = "warning", title = "") {
  return ElMessageBox.confirm(content, title, {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type
  });
}
